import { request } from '@/utils'

export default {
  create: data => request.post('/system/role/create', data),
  read: (params = {}) => request.get('/system/role/list', { params }),
  update: data => request.put('/system/role/update', data),
  updateStatus: data => request.post('/system/role/updateStatus', data),
  delete: data => request.delete(`/system/role/delete`, { data }),

  getRolePermissions: (params = {}) => request.get('/system/role/idList', { params }),
  updateRoleMenu: data => request.post('/system/role/setRoleMenu', data),

  getConfigGroupList: () => request.get('/setting/configGroup/index'),
  createConfigGroup: data => request.post('/setting/configGroup/create', data),
  updateConfigGroup: data => request.put(`/setting/configGroup/update/${data.id}`, data),
  deleteConfigGroup: data => request.delete(`/setting/configGroup/delete/${data.ids}`),

  getConfigList: (params = {}) => request.get('/setting/config/index', { params }),
  createConfig: data => request.post('/setting/config/create', data),
  updateConfig: data => request.put(`/setting/config/update/${data.id}`, data),
  deleteConfig: data => request.delete(`/setting/config/delete/${data.ids}`),
  updateByKeys: data => request.post('/setting/config/updateByKeys', data),
}
